<?php 
		$cateModel=new \Common\Model\cate;
		$catedata=$cateModel->get();
		foreach ($catedata as $k => $v) {
//			所有子分类和自己的cid
			$cids=$cateModel->getson($catedata,$v['cid']);
				
			$cids[]=$v['cid'];
//			通过得到的$cid获得对应的文章数目
			$total=$cateModel->join('article','category_cid','=','cid')->where("cid in(".implode(',', $cids).")")->count();
//			将获得的对应分类总数放到对应的数组里去
			$catedata[$k]['total']=$total;
		}
		
		$catedata=Data::tree($catedata,'cname');
		
		$tagdata=(new \Common\Model\Tag)->get();

 ?>




<aside class="col-md-4 hidden-sm hidden-xs">
						<div class="_widget">
							<h4>关于自己</h4>
							<div class="_info">
								<p>多年一线开发经验与讲师经验。擅长引导思维，而不是一味灌输，新生代优秀青年讲师的代表...</p>
								<p>
									<i class="glyphicon glyphicon-volume-down"></i>
									目前就职于
									<a href="http://www.houdunwang.com" target="_blank">北京后盾网</a>
								</p>
							</div>
						</div>
						<div class="_widget">
							<h4>分类列表</h4>
							
							<div>
							<?php foreach ($catedata as $v){?>
								<a href="l<?php echo $v['cid']?>.html"><?php echo $v['_name']?>(<?php echo $v['total']?>)</a>
							<?php }?>
							</div>
						</div>
						<div class="_widget">
							<h4>标签云</h4>
							<div class="_tag">
								<?php foreach ($tagdata as $v){?>
								<a href="<?php echo U('List/index',array('tid'=>$v['tid']))?>"><?php echo $v['tname']?></a>
								<?php }?>
							</div>
						</div>
						
					</aside>